import { setStore, getStore } from "@/utils/localStorage";
export const saveConfigToLocal = (config: Configs) => {
  // 国际化 默认中文zh
  const locale = getStore({ name: "locale" }) ?? config.Locale ?? "zh";
  setStore({ name: "locale", content: locale });
  // layout模式以及主题
  const layout = getStore({ name: "layout" }) ?? {
    layout: config.Layout ?? "vertical",
    sidebarStatus: config.SidebarStatus ?? true,
    theme: config.Theme ?? "light"
  };
  setStore({ name: "layout", content: layout });
  // 系统配置-界面显示
  const configure = getStore({ name: "configure" }) ?? {
    showTagsView: config.ShowTagsView ?? true,
    cacheTagsView: config.CacheTagsView ?? true
  };
  setStore({ name: "configure", content: configure });
};
